using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace qPrintComponent
{

    //typedef struct _PRINTER_INFO_6 { 
    //  DWORD     dwStatus; 
    //} PRINTER_INFO_6, *PPRINTER_INFO_6; 
    
    public sealed class PrinterInfo6 : qSafePrinterInfo
    {
        internal PrinterInfo6(SafeHandle PrinterHandle)
            : base(PrinterHandle, 6)
        {        
        }
        public override string ToString()
        {
            return Status.ToString();
        }
        
        [Description("Printer status.")]
        public qPrinterStatus Status
        {
            get
            {
                if (this.Size == 0)
                    return new qPrinterStatus(0x800000);
                else
                    return new qPrinterStatus(GetIntField(0));
            }
        }
        [Description("Printer is Pauzed.")]
        [NotifyParentProperty (true)]
        public bool IsPauzed
        {
            get { return Status.Paused; }
            set
            {
                if (value != IsPauzed)
                {
                    if (value)
                        this.PausePrinter();
                    else
                        this.ResumePrinter();
                }
            }
        }
    }
}
